<template>
  <div>
    <div>我是父组件传递的值：{{message}}</div>
    <div>
      <input type="text" v-model="formData.username" @change="setData">
      <!-- <button @click="setData">传值</button> -->
    </div>
  </div>
</template>
<script>
export default {
  name: 'Sons',
  data () {
    return {
      formData:{
        username:''
      }
    }
  },
  props: ['message'],
  mounted () {

  },
  methods: {
    setData (){
      this.$emit('username', this.formData.username);
    }
  }
}
</script>

<style scoped>

</style>

